import unittest
from api.employee import Employee_API
from utils import common_assert


class TestEmployee(unittest.TestCase):
    employee_id = None

    def setUp(self):
        self.employee_api = Employee_API()

    def test01_add_employee(self):
        add_employee_data = {
            "username": "hollyzhi1017t13",
            "mobile": "17700000013",
            "timeOfEntry": "2021-10-17",
            "formOfEmployment": 1,
            "workNumber": "1023090",
            "departmentName": "销售",
            "departmentId": "1266699057968001024",
            "correctionTime": "2021-10-17T16:00:00.000Z"
        }

        response = self.employee_api.add_employee(add_employee_data)
        print(response.json())
        common_assert(self, response)
        # 提取员工id
        # TestEmployee.employee_api = response.json().get("id")
